﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.Windows.Threading;

namespace MHWPA.Views
{
    public partial class VideoPlayer : PhoneApplicationPage
    {
        DispatcherTimer videoTimer = new DispatcherTimer();

        public VideoPlayer()
        {
            InitializeComponent();

            videoTimer.Interval = new TimeSpan(0, 0, 1);
            videoTimer.Tick += new EventHandler(videoTimer_Tick);
        }

        private void PlayPause_Click(object sender, RoutedEventArgs e)
        {
            VideoScreen.Source = new Uri("../Images/20101024_jesus-and-religion_vodcast.wmv", UriKind.Relative);

            VideoScreen.Play();
            videoTimer.Start();
        }

        private void Rewind_Click(object sender, RoutedEventArgs e)
        {

        }

        private void Forward_Click(object sender, RoutedEventArgs e)
        {

        }

        private void videoTimer_Tick(object sender, EventArgs e)
        {
            ProgressBar.Maximum = VideoScreen.NaturalDuration.TimeSpan.Ticks;
            ProgressBar.Value = VideoScreen.Position.Ticks;
        }
    }
}